function cost = computeObj_vecform(robot_input,points_xy,R,mesh_size,r)
    if size(robot_input,2) == 1
        robot = reshape(robot_input,numel(robot_input)/3,3);
    else
        robot = robot_input;
    end
    [r_num,~] = size(robot);dis_num = sqrt(size(points_xy,1)); 
    h = robot(:,end); sensor_para = 20;
    [r,~] = coverageModel(h,sensor_para,'reciprocal');
    count_num = zeros(dis_num^2,r_num);
    for i = 1:r_num
        posi = points_xy - robot(i,1:2);
        dis = vecnorm(posi,2,2);
        count_num(:,i) = (dis< r(i));    
    end   
    
    z = zeros(dis_num^2,1);
    r1 = sum(count_num,2) == 1;  z(r1) = 0.05;
    r1 = sum(count_num,2) == 2;  z(r1) = 0.1;   
    r1 = sum(count_num,2) >=3; r3 = kron(r1,ones(r_num,1)); 
    r2 = reshape(count_num',numel(count_num),1);  r2 = r2&r3;    
    robot_rel = kron(ones(dis_num^2,1),robot);
    points = [kron(points_xy,ones(r_num,1)) zeros(r_num*dis_num^2,1)];

    G = (points - robot_rel);
    G = G.*(r2)./vecnorm(G,2,2);   
    
    k1 = find(r1==1);
    for j = 1:size(k1)
        i = k1(j);
        Gi = G(r_num*(i-1)+1:r_num*(i-1)+r_num,:);
        z(i) = sigmoid(  pdop(Gi)  );
    end
	z = reshape(z,dis_num,dis_num);
    
    cost = - sum(R.*z*mesh_size^2,'all');
end

